import 'package:flutter/material.dart';

class NormalButton extends StatelessWidget {
  final void Function() onPressed;
  final String title;
  final double height;
  final double width;
  final double radius;
  final double fontSize;
  final Color bgColor;
  final Color textColor;
  const NormalButton({
    super.key,
    required this.title,
    required this.onPressed,
    this.height = 40.0,
    this.width = double.infinity,
    this.radius = 10.0,
    this.fontSize = 18.0,
    this.bgColor = Colors.blueAccent,
    this.textColor = Colors.white,
  });

  @override
  Widget build(BuildContext context) {
    return ConstrainedBox(
      constraints: BoxConstraints.expand(height: height,width: width),
      child: ElevatedButton(
        style: ButtonStyle(
          backgroundColor: WidgetStateProperty.all(bgColor),
          shape: WidgetStateProperty.all(
            RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(radius),
            ),
          ),
        ),
        onPressed: onPressed,
        child: Text(title,
            style: TextStyle(
              color: textColor,
              fontSize: fontSize,
            )),
      ),
    );
  }
}
